import time
from libs.funnyGeometry import *


def timer_for_scanner(func):
    """端口扫描计时器"""
    def decorate(cls):
        start = time.time()
        cls.window.textBrowser_scanMsg.append(f"{COUNTER_DIAGONAL_PIXEL}任务开始")
        func(cls)
        end = time.time()
        cls.window.textBrowser_scanMsg.append("{}任务结束，耗时{:.2f}(s)".format(LEADING_DIAGONAL_PIXEL, end-start))
    return decorate
